import time
import numpy as np
from RA_Cal import ReflectArray_cal_FFT, Para_RA, MASK_rp, Costfunction, csvtest
import random
import csv

if __name__ == '__main__':
    import DPGA_new
    # 952 1904 3808
    for i in range(3):
        ga_test = DPGA_new.DPGA_new(CF_tt=[110, 200, 260, 320, 400], n_code=952*2,
                            population_size=500, generations=1200, casei=4, div_population_ratio=1,
                            precise_population_ratio=0.05)
        optimized_code, optimized_result = ga_test.run()

        # BestCode_result_file = r"Code_case3_0423.csv"
        # with open(BestCode_result_file, 'a', encoding='utf-8', newline='') as f:
        #     write = csv.writer(f)
        #     write.writerow(list(optimized_code))
